<script setup>
import { ref } from 'vue';

const list = ref([{ name: '2024年' }, { name: '2024年' }, { name: '2024年' }]);

const items = ref([])
for (let i = 1; i < 5; i++) {
	items.value.push({
		title: i + '月',
		value: i + '000'
	})
}

let year = ''
let month = ''
const tabFn = (index) => {
	const year = index.name
	console.log('index', index);
}
const cellFn = (title) => {
	const month = title.name
	if (year == '') {
		year = new Date().getFullYear()
	}
	// if (!year) year = new Date().getFullYear()
	console.log('index', title);
	uni.navigateTo({ url: `/pages/money/detail/index?year=${year}&month=${month}` })
}
</script>

<template>
	<view class="bg">
		<up-sticky>
			<up-tabs :list="list" lineColor="#001F79;" activeStyle="color:#001F79;" @click="tabFn"></up-tabs>
		</up-sticky>

		<up-cell-group customStyle="background:#fff">
			<up-cell size="large" :title="v.title" :value="v.value" isLink v-for="v in items" :key="v" @click="cellFn"
				:name="v.title"></up-cell>
		</up-cell-group>
	</view>
</template>

<style lang="less" scoped></style>
